package org.example.greenhouse.dao;

import org.example.greenhouse.entity.Device;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import java.util.List;


public interface DeviceDao extends JpaRepository<Device, Integer> {


//      根据 deviceName 查询设备列表
    List<Device> findByDeviceName(String deviceName);

    int countByGreenHouseId(Long greenHouseId);

    // 根据 greenHouseId 查询设备列表
    List<Device> findByGreenHouseId(Long greenHouseId);
}